package com.example.eschool;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;

import com.example.eschool.bean.Message;
import com.example.eschool.bean.News;
import com.example.eschool.fragment.CardFragment;
import com.example.eschool.fragment.HomeFragment;
import com.example.eschool.fragment.MessageFragment;
import com.example.eschool.fragment.PersonFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * 第一个启动Activity
 */
public class MessageActivity extends AppCompatActivity {

    private ListView listView;
    private MessageAdapter messageAdapter;
    private List<Message> messageList;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_message);
        listView = findViewById(R.id.messageList);
        messageList=new ArrayList<>();
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));
        messageList.add(new Message("[支付中心]一卡通充值","￥200元","系统通知","2024-5-13","农行支付，支付成功"));

        messageAdapter=new MessageAdapter(this,messageList);
        listView.setAdapter(messageAdapter);
    }
}